FROM 172.16.10.13/startdt/tomcat:v1

MAINTAINER YEFEI

ARG MODULE=hellomaven
ARG WAR=helloMaven.war

RUN mkdir /home/admin/${MODULE}/{logs,webapps} -p

COPY ./server.xml /usr/local/tomcat/conf/

COPY ./catalina.sh /usr/local/tomcat/bin/catalina.sh

RUN chmod 0750 /usr/local/tomcat/bin/catalina.sh

COPY ./target/${WAR} /home/admin/${MODULE}/webapps/

WORKDIR /home/admin/${MODULE}/webapps/

RUN unzip ${WAR} && rm -rf ${WAR}

EXPOSE 8081

CMD /usr/local/tomcat/bin/catalina.sh start && tail -f /usr/local/tomcat/logs/catalina.out
